package requests

import (
	"github.com/goravel/framework/contracts/http"
	"github.com/goravel/framework/contracts/validation"
)

type UserRequest struct {
	Account string `json:"account" form:"account"`

	Pwd string `json:"pwd" form:"pwd"`

	RealName string `json:"real_name" form:"real_name"`

	Birthday string `json:"birthday" form:"birthday"`

	CardId string `json:"card_id" form:"card_id"`

	Mark string `json:"mark" form:"mark"`

	PartnerId string `json:"partner_id" form:"partner_id"`

	GroupID int64 `json:"group_id" form:"group_id"`

	Nickname string `json:"nickname" form:"nickname"`

	Avatar string `json:"avatar" form:"avatar"`

	Phone string `json:"phone" form:"phone"`

	AddTime string `json:"add_time" form:"add_time"`

	AddIp string `json:"add_ip" form:"add_ip"`

	LastTime string `json:"last_time" form:"last_time"`

	LastIp string `json:"last_ip" form:"last_ip"`

	NowMoney string `json:"now_money" form:"now_money"`

	BrokeragePrice string `json:"brokerage_price" form:"brokerage_price"`

	Integral string `json:"integral" form:"integral"`

	Exp string `json:"exp" form:"exp"`

	SignNum string `json:"sign_num" form:"sign_num"`

	SignRemind string `json:"sign_remind" form:"sign_remind"`

	Status int64 `json:"status" form:"status"`

	Level int64 `json:"level" form:"level"`

	AgentLevel string `json:"agent_level" form:"agent_level"`

	SpreadOpen int64 `json:"spread_open" form:"spread_open"`

	SpreadUid string `json:"spread_uid" form:"spread_uid"`

	SpreadTime string `json:"spread_time" form:"spread_time"`

	UserType string `json:"user_type" form:"user_type"`

	IsPromoter int64 `json:"is_promoter" form:"is_promoter"`

	PayCount string `json:"pay_count" form:"pay_count"`

	SpreadCount string `json:"spread_count" form:"spread_count"`

	CleanTime string `json:"clean_time" form:"clean_time"`

	Addres string `json:"addres" form:"addres"`

	Adminid string `json:"adminid" form:"adminid"`

	LoginType string `json:"login_type" form:"login_type"`

	RecordPhone string `json:"record_phone" form:"record_phone"`

	IsMoneyLevel string `json:"is_money_level" form:"is_money_level"`

	IsEverLevel string `json:"is_ever_level" form:"is_ever_level"`

	OverdueTime string `json:"overdue_time" form:"overdue_time"`

	Uniqid string `json:"uniqid" form:"uniqid"`

	DivisionName string `json:"division_name" form:"division_name"`

	DivisionType string `json:"division_type" form:"division_type"`

	DivisionStatus string `json:"division_status" form:"division_status"`

	IsDivision string `json:"is_division" form:"is_division"`

	IsAgent string `json:"is_agent" form:"is_agent"`

	IsStaff string `json:"is_staff" form:"is_staff"`

	DivisionId string `json:"division_id" form:"division_id"`

	AgentId string `json:"agent_id" form:"agent_id"`

	StaffId string `json:"staff_id" form:"staff_id"`

	DivisionPercent string `json:"division_percent" form:"division_percent"`

	DivisionChangeTime string `json:"division_change_time" form:"division_change_time"`

	DivisionEndTime string `json:"division_end_time" form:"division_end_time"`

	DivisionInvite string  `json:"division_invite" form:"division_invite"`
	LabelIDs       []int64 `json:"label_id" form:"label_id"`
}

func (r *UserRequest) Authorize(ctx http.Context) error {
	return nil
}

func (r *UserRequest) Rules(ctx http.Context) map[string]string {
	return map[string]string{
		"real_name": "required",
		"phone":     "required",
		"pwd":       "required",
	}
}

func (r *UserRequest) Messages(ctx http.Context) map[string]string {
	return map[string]string{}
}

func (r *UserRequest) Attributes(ctx http.Context) map[string]string {
	return map[string]string{}
}

func (r *UserRequest) PrepareForValidation(ctx http.Context, data validation.Data) error {
	return nil
}
